	 function validator(data,validators){
		this.data = data;
		this.validators = validators;
	 }

	 validator.prototype.vtool = function(){
	 	for(var d in this.data){
				for(var v in this.validators){
					for(var vi in this.validators.length == 0 || this.validators == undefined ? !this.validators : this.validators){
						if(d == this.validators[v][vi]){
							if(typeof(this.validators[v][1]) == 'function'){
								this.validators[v][1]();
							}else if(typeof(this.validators[v][1]) == 'string'){
								if(!new RegExp(this.validators[v][1]).test(this.data[d])){
									if(typeof(this.validators[v][2]) == 'string'){
											alert( this.validators[v][2] );
									}else if(typeof(this.validators[v][2]) == 'function'){
											this.validators[v][2]();
									}
								}else{
									validators.splice(v,1);
								}
							}
						}

					}
				}
			}
	 }

	 function it(data,validators){
		if(!islegal(data) || !islegal(validators)){
			return;
		}
		if(data.length > validators.length){
			alert('data.length >=  validators.length');
			return;
		}
		for(var d in data){
			for(var v in validators){
				for(var vi in validators.length == 0 || validators == undefined ? !validators : validators){
					if(d == validators[v][vi]){
						if(typeof(validators[v][1]) == 'function'){
							validators[v][1]();
						}else if(typeof(validators[v][1]) == 'string'){
							if(!new RegExp(validators[v][1]).test(data[d])){
								if(typeof(validators[v][2]) == 'string'){
										alert( validators[v][2] );
								}else if(typeof(validators[v][2]) == 'function'){
										validators[v][2]();
								}
							}else{
								validators.splice(v,1);
							}
						}
					}

				}
			}
		}
	}

function islegal(obj){
	if(typeof(obj) != 'object' || obj == 'undefined'){
		alert('obj is error');
		return false;	
	}
	return true;
}

